package com.vim.modules.mall.service.impl;

import com.github.pagehelper.PageInfo;
import com.vim.common.utils.AssertUtils;
import com.vim.modules.mall.model.base.CommonPage;
import com.vim.modules.mall.model.base.MallResponseEntity;
import com.vim.modules.mall.model.base.Page;
import com.vim.modules.mall.model.base.PageConvertUtils;
import com.vim.modules.mall.model.mallMember.MallMember;
import com.vim.modules.mall.service.MallMemberService;
import com.vim.modules.mall.service.remote.RemoteMallMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @作者 Administrator
 * @时间 2020-10-04 19:27
 * @版本 1.0
 */
@Service
public class MallMemberServiceImpl implements MallMemberService {

    @Autowired
    private RemoteMallMemberService remoteMallMemberService;

    @Override
    public PageInfo<MallMember> memberList(Page page, String memberName) {
        MallResponseEntity<CommonPage<MallMember>> result = remoteMallMemberService.memberList(memberName, page.getPageNo(), page.getPageSize());
        AssertUtils.assertAjaxOK(result);
        return PageConvertUtils.convert(result.getData());
    }
}
